#!/usr/bin/env bash
set -ex

spring_application_name="springboot-seventeen"

PS_ID=$(ps -ef | grep ${spring_application_name}-0.0.1-SNAPSHOT.jar | grep -v grep | cut -c 9-15)
if [ ${PS_ID} ]; then
    kill -9 ${PS_ID}
fi


mkdir -p log
touch log/${spring_application_name}_all.log
touch log/${spring_application_name}_error.log
ls -alh log

java -Djava.security.egd=file:/dev/./urandom -jar ${spring_application_name}-0.0.1-SNAPSHOT.jar 2>>log/${spring_application_name}_error.log &

#tail -f -n 10 log/${spring_application_name}_all.log